package com.chao.ioc.factory;

import java.util.Map;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;

/**
 * @author : Rookie
 * @description : bean注册器
 * @date : 2023/10/4
 */
public class BeanRegister {

    private final Map<String,Object> singletonBeanMap = new ConcurrentHashMap<>(16);

    public Object getBean(String beanName) {
        return singletonBeanMap.get(beanName);
    }

    public void registerBean(String beanName,Object bean) {
        singletonBeanMap.put(beanName, bean);
    }
}
